<?php $CDN= $this->CommonHelper()->imageDomain();?>
<body class="app" data-ad="true">
<script src="/mobile/js/iscroll-zoom.js?<?php echo $this->CommonHelper()->version();?>"></script>
<section class="app-content">
	<section class="page page-index page-b noline" data-plugin-type="info_front">

        <div class="swiper-banner">
            <ul class="swiper-wrapper">
                <li class="swiper-slide"><img src="/mobile/images/banner_source01.jpg"></li>
                <li class="swiper-slide"><img src="/mobile/images/banner_source01.jpg"></li>
            </ul>
            <div class="pagination-banner"></div>
        </div>

        <div class="info-list bw mt20">
            <h3 class="source-tit">材料或单位</h3>
			<dl style="display: none;">
                <dt class="i-title">&nbsp;</dt>
                <dd><input id="materialId" type="text" value="<?php echo $this->materialDetail['material_id'] ?>"></dd>
            </dl>
            <dl>
                <dt class="i-title"><b>源 头</b></dt>
                <dd><?php echo $this->materialDetail['original']; ?></dd>
            </dl>
            <dl>
                <dt class="i-title"><b>简 介</b></dt>
                <dd><?php echo $this->materialDetail['description']; ?></dd>
            </dl>
            <dl>
                <dt class="i-title"><b>生产流程</b></dt>
                <dd><?php echo $this->materialDetail['workflow']; ?></dd>
            </dl>
            <dl>
                <dt class="i-title"><b>特 点</b></dt>
                <dd><?php echo $this->materialDetail['feature']; ?></dd>
            </dl>
            <dl>
                <dt class="i-title"><b>联系方式</b></dt>
                <dd><?php echo $this->materialDetail['contact']; ?></dd>
            </dl>
            <dl>
                <dt class="i-title"><b>地 址</b></dt>
                <dd><?php echo $this->materialDetail['address']; ?></dd>
            </dl>
        </div>

        <div class="info-list bw mt20">
            <dl>
                <dt class="i-title"><b>最新监测报告</b></dt>
                <dd>&nbsp;</dd>
            </dl>
            <div id="imgReport" class="pic-list">
                <?php foreach($this->monitorReports as $k=>$monitorReport):?>
                <img src="<?php echo "{$CDN}{$monitorReport['image']}"; ?>">
                <?php endforeach;?>
            </div>
            
        </div>
	</section>

    <div class="source-b-bar">
        <div class="cal-wrap">
            <select id="cal-year">
            	<?php foreach($this->_date['y'] as $year):?>
            	<option value='<?php echo "{$year}"; ?>'><?php echo "{$year}"?></option>
            	<?php endforeach;?>
            </select><span>年</span>
            <select id="cal-month">
                <?php foreach($this->_date['m'] as $month):?>
            	<option value='<?php echo "{$month}"; ?>'><?php echo "{$month}"?></option>
            	<?php endforeach;?>
            </select><span>月</span>
            <select id="cal-day">
                <?php foreach($this->_date['d'] as $day):?>
            	<option value='<?php echo "{$day}"; ?>'><?php echo "{$day}"?></option>
            	<?php endforeach;?>
            </select><span>日</span>
        </div>
        <a class="btn-cal-search" href="javascript:searchReport();">查 询</a>
    </div>

    <!-- 底部menu-->
    <?php echo $this->partial('public/menu.phtml'); ?>
</section>
<script type="text/javascript">

var mReport="<img src='' />";
var $mReport=$(mReport);
var CDN ='<?php echo "{$CDN}";?>';

function searchReport(){
	var year=$("#cal-year").val();
	var month=$("#cal-month").val();
	var day=$("#cal-day").val();
	var materialId=$("#materialId").val();
	$.ajax({
		url:"/material/searchReport",
		type:"post",
		data:{year:year,month:month,day:day,materialId:materialId},
		dataType:"json",
		success:function(rs){
			var imgHtml="";
			for(var i=0;i<rs.length;i++){
				$mReport.attr("src",CDN+rs[i]['image']);
				imgHtml += $mReport.prop('outerHTML');
			}
			$("#imgReport").html(imgHtml);
		}
	});
	
}



$(function () {
    var swiper = new Swiper('.swiper-banner', {
        pagination: '.pagination-banner',
        paginationClickable: true,
        loop: true,
        autoplay: 5000
    });
});
</script>
